using System;

namespace nHydrate.EFCore.DataAccess
{
	public partial interface IReadOnlyBusinessObject : nHydrate.EFCore.DataAccess.INHEntityObject
	{
		/// <summary>
		/// If applicable, returns the maximum number of characters the specified field can hold
		/// </summary>
		/// <param name="field"></param>
		/// <returns>If not applicable, the return value is 0</returns>
		int GetMaxLength(Enum field);

		/// <summary>
		/// Returns the primary key for this object
		/// </summary>
		IPrimaryKey PrimaryKey { get; }

		/// <summary>
		/// Determines if the specified object is equivalent to the current object
		/// </summary>
		/// <param name="item"></param>
		/// <returns></returns>
		bool IsEquivalent(INHEntityObject item);
		System.Type GetFieldNameConstants();

		/// <summary>
		/// Gets the value of a field specified by the enumeration
		/// </summary>
		/// <param name="field">The from which to get the value</param>
		/// <returns></returns>
		object GetValue(Enum field);

		/// <summary>
		/// Gets the value of a field specified by the enumeration
		/// </summary>
		/// <param name="field">The from which to get the value</param>
		/// <param name="defaultValue">The default value to return if the value is null</param>
		/// <returns></returns>
		object GetValue(Enum field, object defaultValue);

		/// <summary>
		/// Returns the system type of the specified field
		/// </summary>
		/// <param name="field"></param>
		/// <returns></returns>
		System.Type GetFieldType(Enum field);
	}
}
